package com.agent.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
public class User {
    // 主键 id，自增
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String username;
    private String password;
    private Integer stated;  // 状态: 0禁用, 1启用
//    @TableLogic(value = "0", delval = "1")
    private Integer deleted; // 删除：0未删除, 1已删除
    private String email;

    @TableField(fill = FieldFill.INSERT)        // 插入时，自动填充
    private LocalDateTime createdAt;
    @TableField(fill = FieldFill.INSERT_UPDATE) // 插入和修改时，自动填充
    private LocalDateTime updatedAt;
}
